package com.corpdata.app.statistical.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.corpdata.app.statistical.entity.EChartCarrier;
import com.corpdata.app.statistical.service.StatisticalService;
import com.corpdata.common.domain.DataGridRequestDTO;
import com.corpdata.core.base.BaseController;

@Controller
@RequestMapping("/app/statistical")
public class StatisticalController extends BaseController{

	@Autowired
	private StatisticalService statisticalService;
	
	@GetMapping("index")
	public String index() {
		return "app/statistical/index";
	}
	
	/**
	 **跳转会议室统计
	 * @return
	 */
	@GetMapping("conferenceRoom")
	public String conferenceRoom() {
		return "app/statistical/conference_room";
	}
	
	/**
	 * 会议室使用率
	 * @return
	 */
	@PostMapping("roomUsageRate")
	@ResponseBody
	public List<EChartCarrier> roomUsageRate(DataGridRequestDTO dgRequest) {
		return statisticalService.roomUsageRate(dgRequest.getParams());
	}
}
